package com.ifox.hgx.spring.factory;

import com.ifox.hgx.spring.bean.Car;
import org.springframework.beans.factory.FactoryBean;

/**
 * Copyright (C), 2017-2018, 成都艾弗克斯科技有限公司
 * Author:   hanguixian
 * Date:     2018/10/21 11:34
 * Description:
 */
public class CarFactoryBean implements FactoryBean<Car> {

    //返回Bean的对象
    @Override
    public Car getObject() throws Exception {
        return new Car(1,"大奔");
    }

    //返回Bean的类型
    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }

    //返回的实例是不是单实例的
    @Override
    public boolean isSingleton() {
        return true;
    }
}
